package io;

import java.io.*;

public class FileCopyDemo03 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream bis =
                new BufferedInputStream(
                        new FileInputStream("img.png")
                );
        BufferedOutputStream bos =
                new BufferedOutputStream(
                        new FileOutputStream("a.png")
                );

        byte[] data = new byte[16];
        int len;
        while ((len=bis.read(data))!=-1){
            bos.write(data,0,len);
        }
        bos.flush();

        bis.close();
        bos.close();
    }


}
